package com.my.chapter14;

public class practice2 {
    static void printInfo(Class<?> cc) {
        System.out.println("Class name: " + cc.getName() +
                " is interface? [" + cc.isInterface() + "]");
        System.out.println("Simple name: " + cc.getSimpleName());
        System.out.println("Canonical name : " + cc.getCanonicalName());
    }

    public static void main(String[] args) {
        Class<?> c = null;
        try {
            c = Class.forName("com.my.chapter14.FancierToy");
        } catch(ClassNotFoundException e) {
            System.out.println("Can't find FancierToy");
            System.exit(1);
        }
        printInfo(c);
        System.out.println("");

        for(Class<?> face : c.getInterfaces())
            System.out.println(face.getSimpleName());
    }
}

interface HasCPU {}
class FancierToy extends FancyToy implements HasCPU {}
